package com.finger.gulimall.product.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Date;

import com.finger.common.valid.AddGroup;
import com.finger.common.valid.UpdateGroup;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;

/**
 * 属性分组
 *
 * @author finger
 * @email 909128695@qq.com
 * @date 2022-03-16 12:43:42
 */
@Data
@TableName("pms_attr_group")
public class AttrGroupEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     * 分组id
     */
    @TableId
    @Null(message = "添加Id必须为空", groups = AddGroup.class)
    @NotNull(message = "更新Id不能为空", groups = UpdateGroup.class)
    private Long attrGroupId;
    /**
     * 组名
     */
    @NotBlank(message = "添加属性不能为空", groups = {AddGroup.class})
    private String attrGroupName;
    /**
     * 排序
     */
    @NotNull(message = "添加属性不能为空", groups = {AddGroup.class})
    @Min(message = "排序必须大于0", groups = {AddGroup.class, UpdateGroup.class}, value = 0)
    private Integer sort;
    /**
     * 描述
     */
    @NotBlank(message = "添加属性不能为空", groups = {AddGroup.class})
    private String descript;
    /**
     * 组图标
     */
    @NotBlank(message = "添加属性不能为空", groups = {AddGroup.class})
    private String icon;
    /**
     * 所属分类id
     */
    @NotNull(message = "添加属性不能为空", groups = {AddGroup.class})
    private Long catelogId;

    /**
     * 三级菜单的全部路径Id
     */
    @TableField(exist = false)
    private Long[] paths;

}
